package org.ccay.sitemap.service.internal;

import java.util.Collection;
import java.util.List;

import org.ccay.sitemap.SiteMapApplicationException;
import org.ccay.sitemap.SiteNodeSimpleVO;
import org.ccay.sitemap.SiteNodeVO;

/**
 * siteMap树构造类	
 * @author chaowangbang
 * @since 2011-10-24
 */
public interface ISiteMapBuilder {

	/** 
	 * 构造完整的导航菜单
	 * @param siteMapNodes
	 * @return
	 * @throws SiteMapApplicationException 
	 */
	SiteNodeVO buildWholeSiteMap(List<SiteNodeVO> siteMapNodes) throws SiteMapApplicationException;
	
	/** 
	 * 构造导航子菜单
	 * @param siteMapNodes 节点列表
	 * @param parentId 父节点ID
	 * @return
	 * @throws SiteMapApplicationException 
	 */
	SiteNodeVO buildWholeSiteMap(List<SiteNodeVO> siteMapNodes, int parentId) throws SiteMapApplicationException;
	
	/** 
	 * 根据语言构造完整的导航菜单
	 * @param siteMapNodes
	 * @return
	 * @throws SiteMapApplicationException 
	 */
	SiteNodeVO buildWholeSiteMapByLanguage(List<SiteNodeVO> siteMapNodes, String language) throws SiteMapApplicationException;
	
	/** 
	 * 根据语言构造导航子菜单
	 * @param siteMapNodes 节点列表
	 * @param parentId 父节点ID
	 * @return
	 * @throws SiteMapApplicationException 
	 */
	SiteNodeVO buildWholeSiteMapByLanguage(List<SiteNodeVO> siteMapNodes, int parentId, String language) throws SiteMapApplicationException;
	
	/** 
	 * 构造基于角色的导航树
	 * @param viewName
	 * @param grantedOperations
	 * @param siteMapRootNode
	 * @return
	 */
	SiteNodeSimpleVO buildRoleSiteMap(Collection<String> operations,SiteNodeVO siteMapRootNode);
}
